﻿using System;
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;

//NormalListView中的Item
public class ListPanelItem<DataType> : MonoBehaviourUI,IPointerClickHandler
    where DataType : ListPanelData
{
    private DataType _data;
    private Action _itemClickEvent ;

    public virtual void SetData(DataType data)
    {
        _data = data;
    }

    public void OnPointerClick(PointerEventData eventData)
    {
        if (_itemClickEvent != null)
            _itemClickEvent();
    }

    public void SetItemClickEvent(Action itemClickEvent)
    {
        _itemClickEvent = itemClickEvent;
    }
}


